﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Hospital.Common;
using Hospital.BLL.IBLL;

namespace Hospital.Web
{
    public partial class EditAnnouncement : System.Web.UI.Page
    {
        #region Member
        private IAnnouncementService announcementService;
        #endregion

        #region Property
        public IAnnouncementService AnnouncementService
        {
            set { announcementService = value; }
            get { return announcementService; }
        }
        #endregion

        #region Load
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid AnnounceId = ConvertHelper.GetGuid(Request.QueryString["Id"]);
            LoadAllAnnounceById(AnnounceId);
        }
        #endregion

        #region Function
        private void LoadAllAnnounceById(Guid Id)
        {
            Hospital.Model.Announcement announce = announcementService.GetAnnouncementById(Id);
            this.lPublishDate.Text = announce.PublishDate.ToString("yyyy-MM-dd");
            this.tbTitle.Text = announce.Title;
            this.tbContent.Text = announce.Content;
        }
        #endregion
    }
}
